import { get, post } from "./http";
import store from "@/store";
import httpUtils from "@/api/httpUtils";

export const phoneLogin = (query) => post("/person/code/login", query);
export const getSmsCodeToken = (query) =>
  post("/person/sms/create_token.thtml", query);
export const getSmsCode = (query) => post("/person/sms/send", query);
export const logout = (query) => get("/sys/logout", query);
// export const getUserInfo = (query) =>  get('/personal/v1/piInfo/queryById', query)
export const opJobDetail = (query) => get("/personal/opJob/queryById", query);
export const companyInfo = (query) => get("/personal/enInfo/queryById", query);
export const baseSo = (query) => get("/base/so", query);
export const baseBlock = (query) => get("/base/block", query);
export const baseData = (query) => get("/base/data", query);
export const myList = (query) =>
  get("/personal/v1/opBrowseHistory/list", query);
export const collectionAdd = (query) =>
  post("/personal/v1/opCollection/add", query);
export const collectionDel = (query) =>
  post("/personal/v1/opCollection/delete", query);
export const collectState = (query) =>
  post("/personal/v1/opCollection/collectState", query);
export const cvResumeList = (query) => get("/personal/v1/cvResume/list", query);
export const opDeliveryHistoryAdd = (query) =>
  post("/personal/v1/opDeliveryHistory/add", query);
export const canSend = (query) => post("/personal/v1/piInfo/resumeFlag", query);
export const topList = (query, header) =>
  get("/personal/top/job/list", query, header);
export const topCollect = (query, header) =>
  get("/personal/top/job/add", query, header);
export const topToken = (query, header) =>
  post("/personal/top/job/token", query, header);
export const uploadTopFile = (params, goLogin) => {
  return httpUtils.post("/personal/top/job/upload", params, goLogin);
};
export const getTopResume = (params, goLogin) => {
  return httpUtils.get(
    "/personal/v1/newResume/getResumeInfoByUserId",
    params,
    goLogin
  );
};

//保活接口
export const keepAlive_getToken = (query) =>
  post("/personal/keepAlive/getToken", query);

// 简历相关

//个人信息查询
export const personInfo = (params, goLogin) => {
  return httpUtils.get("/personal/v1/piInfo/queryById", params, goLogin);
};

//个人信息各个数量
export const personInfoEnterNum = (params, goLogin) => {
  return httpUtils.get("/personal/v1/piInfo/getInfoNum", params, goLogin);
};

//个人信息编辑
export const personInfoEdit = (params, goLogin) => {
  return httpUtils.post("/personal/v1/piInfo/edit", params, goLogin);
};

//个人信息头像保存
export const updatePhoto = (params, goLogin) => {
  return httpUtils.post("/personal/v1/piInfo/updatePhoto", params, goLogin);
};

//查询简历
export const getResume = (params, goLogin) => {
  return httpUtils.get(
    "/personal/v1/cvResume/getResumeInfoByUserId",
    params,
    goLogin
  );
};

//检查简历完成情况
export const resumeCheck = (params, goLogin) => {
  return httpUtils.get("/personal/v1/cvResume/check", params, goLogin);
};

//简历本历查询
export const resumeList = (params, goLogin) => {
  return httpUtils.get("/personal/v1/cvResume/list", params, goLogin);
};

//调取附件简历
export const getResumeBriny = (params, goLogin) => {
  return httpUtils.get("/personal/v1/cvResume/getResumeBriny", params, goLogin);
};

//获取文件下载签名
export const getSign = (params, goLogin) => {
  return httpUtils.post("/sys/common/sign", params, goLogin);
};

//简历本历添加
export const resumeAdd = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvResume/add", params, goLogin);
};

//根据简历id更新在线简历详情（中文）
export const updateResumeInfo = (params, goLogin) => {
  return httpUtils.get(
    "/personal/v1/cvResume/updateResumeInfo",
    params,
    goLogin
  );
};
//根据简历id更新在线简历详情（英文）
export const updateResumeInfoEn = (params, goLogin) => {
  return httpUtils.get(
    "/personal/v1/cvResume/updateResumeInfoEn",
    params,
    goLogin
  );
};

//简历本历删除
export const resumeDelete = (params, goLogin) => {
  return httpUtils.get("/personal/v1/cvResume/delete", params, goLogin);
};

//教育经历编辑
export const eduInfoEdit = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvUserEduInfo/edit", params, goLogin);
};

//教育经历添加
export const eduInfoAdd = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvUserEduInfo/add", params, goLogin);
};

//教育经历删除
export const eduInfoDelete = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvUserEduInfo/delete", params, goLogin);
};

//工作经验编辑
export const workInfoEdit = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvUserWorkInfo/edit", params, goLogin);
};

//工作经验添加
export const workInfoAdd = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvUserWorkInfo/add", params, goLogin);
};

//工作经验删除
export const workInfoDelete = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvUserWorkInfo/delete", params, goLogin);
};

//求职意向 期望职位编辑
export const workIntentionEdit = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvWorkIntention/edit", params, goLogin);
};

//家庭成员删除
export const cvFamilyMemberDelete = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvFamilyMember/delete", params, goLogin);
};
//家庭成员添加
export const cvFamilyMemberAdd = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvFamilyMember/add", params, goLogin);
};

//家庭成员编辑
export const cvFamilyMemberEdit = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvFamilyMember/edit", params, goLogin);
};

//期望职位添加
export const workIntentionAdd = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvWorkIntention/add", params, goLogin);
};

//期望职位删除
export const workIntentionDelete = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvWorkIntention/delete", params, goLogin);
};

//简历本历编辑
export const resumeEdit = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvResume/edit", params, goLogin);
};

//项目经历添加
export const projectInfoAdd = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvProjectInfo/add", params, goLogin);
};

//项目经历编辑
export const projectInfoEdit = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvProjectInfo/edit", params, goLogin);
};

//项目经历删除
export const projectInfoDelete = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvProjectInfo/delete", params, goLogin);
};

//培训经历添加
export const trainInfoAdd = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvTrain/add", params, goLogin);
};

//培训经历编辑
export const trainInfoEdit = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvTrain/edit", params, goLogin);
};

//培训经历删除
export const trainInfoDelete = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvTrain/delete", params, goLogin);
};

//语言能力添加
export const languageInfoAdd = (params, goLogin) => {
  return httpUtils.post(
    "/personal/v1/cvLanguageLevel/personal/add",
    params,
    goLogin
  );
};

//语言能力编辑
export const languageInfoEdit = (params, goLogin) => {
  return httpUtils.post(
    "/personal/v1/cvLanguageLevel/personal/edit",
    params,
    goLogin
  );
};

//语言能力删除
export const languageInfoDelete = (params, goLogin) => {
  return httpUtils.post(
    "/personal/v1/cvLanguageLevel/personal/delete",
    params,
    goLogin
  );
};

//特长技能添加
export const skillInfoAdd = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvSkills/add", params, goLogin);
};

//特长技能编辑
export const skillInfoEdit = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvSkills/edit", params, goLogin);
};

//特长技能删除
export const skillInfoDelete = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvSkills/delete", params, goLogin);
};

//资质证书添加
export const certificateInfoAdd = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvCertificate/add", params, goLogin);
};

//资质证书编辑
export const certificateInfoEdit = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvCertificate/edit", params, goLogin);
};

//资质证书删除
export const certificateInfoDelete = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvCertificate/delete", params, goLogin);
};

//简历附件删除
export const resumeFileDelete = (params, goLogin) => {
  return httpUtils.post("/personal/v1/cvResume/file/delete", params, goLogin);
};

//职位详情
export const jobDetails = (params, goLogin) => {
  return httpUtils.get("/personal/opJob/queryById", params, goLogin);
};

//看过的职位
export const browseHistory = (params, goLogin) => {
  return httpUtils.get("/personal/v1/opBrowseHistory/list", params, goLogin);
};

//收藏职位
export const collectionAdd1 = (params, goLogin) => {
  return httpUtils.post("/personal/v1/opCollection/add", params, goLogin);
};

//收藏职位状态
export const collectState1 = (params, goLogin) => {
  return httpUtils.post(
    "/personal/v1/opCollection/collectState",
    params,
    goLogin
  );
};

//收藏职位状态
export const collectStateList = (params, goLogin) => {
  return httpUtils.post(
    "/personal/v1/opCollection/collectStateList",
    params,
    goLogin
  );
};

//收藏职位状态
export const collectionDelete = (params, goLogin) => {
  return httpUtils.post("/personal/v1/opCollection/delete", params, goLogin);
};

//投递简历
export const postResume = (params, goLogin) => {
  return httpUtils.post("/personal/v1/opDeliveryHistory/add", params, goLogin);
};

//公司主页
export const companyIndex = (params, goLogin) => {
  return httpUtils.get("/personal/enInfo/queryById", params, goLogin);
};

//专场列表
export const specialList = (params, goLogin) => {
  return httpUtils.get("/personal/ssSession/list", params, goLogin);
};

//专场列表（原始版）
export const specialList2 = (params, goLogin) => {
  return httpUtils.get("/personal/ssSession2/list", params, goLogin);
};

//专场详情
export const specialDetail = (params, goLogin) => {
  return httpUtils.get("/personal/ssSession/queryById", params, goLogin);
};

//专场详情职位
export const specialDetailJob = (params, goLogin) => {
  return httpUtils.get("/personal/ssSession/getJobList", params, goLogin);
};

//数据查询(数据分类 industry 行业, position 职位职类, province 省/直辖市, city 市, district 区 )
export const baseData1 = (params, goLogin) => {
  return httpUtils.get("/base/data", params, goLogin);
};

//数据搜索 (数据分类 position 职位, university 学校, speciality 专业  )
export const baseSearch = (params, goLogin) => {
  return httpUtils.get("/base/so", params, goLogin);
};

//区块查询 (数据分类 position 职位, university 学校, speciality 专业  )
export const block = (params, goLogin) => {
  return httpUtils.get("/base/block", params, goLogin);
};

//上传文件
export const uploadFile = (params, goLogin) => {
  return httpUtils.post("/sys/common/upload", params, goLogin);
};

//栏目接口
export const cmsChannel_list = (params, goLogin) => {
  return httpUtils.get("/personal/cmsChannel/list", params, goLogin);
};

//内容列表接口
export const cmsContent_list = (params, goLogin) => {
  return httpUtils.get("/personal/cmsContent/list", params, goLogin);
};

//内容详情
export const cmsContent_queryById = (params, goLogin) => {
  return httpUtils.get("/personal/cmsContent/queryById", params, goLogin);
};

//企业列表接口
export const eninfo_list = (params, goLogin) => {
  return httpUtils.get("/personal/eninfo/list", params, goLogin);
};

//我的消息列表
export const messageList = (params, goLogin) => {
  return httpUtils.get("/personal/v1/enNews/list", params, goLogin);
};

//我的消息未读数量
export const messageCount = (params, goLogin) => {
  return httpUtils.post("/personal/v1/enNews/count", params, goLogin);
};

//修改手机号
export const changePhone = (params, goLogin) => {
  return httpUtils.post("/personal/v1/piInfo/modify_phone", params, goLogin);
};

//个人中心-我期望的职位
export const workIntention = (params, goLogin) => {
  return httpUtils.get("/personal/v1/cvWorkIntention/list", params, goLogin);
};

//个人中心-投递记录
export const postRecord = (params, goLogin) => {
  return httpUtils.get("/personal/v1/opDeliveryHistory/list", params, goLogin);
};

//个人中心-面试邀请
export const interviewRecord = (params, goLogin) => {
  return httpUtils.get("/personal/v1/opInterviewHistory/list", params, goLogin);
};

//个人中心-面试邀请详情
export const interviewDetails = (params, goLogin) => {
  return httpUtils.get(
    "/personal/v1/opInterviewHistory/queryById",
    params,
    goLogin
  );
};

//个人中心-入职邀请
export const entryRecord = (params, goLogin) => {
  return httpUtils.get("/personal/v1/opEntryHistory/list", params, goLogin);
};

//个人中心-入职邀请详情
export const entryDetails = (params, goLogin) => {
  return httpUtils.get(
    "/personal/v1/opEntryHistory/queryById",
    params,
    goLogin
  );
};

//个人中心-我的收藏
export const myCollectRecord = (params, goLogin) => {
  return httpUtils.get("/personal/v1/opCollection/list", params, goLogin);
};

//个人中心-接受或拒绝面试
export const acceptInview = (params, goLogin) => {
  return httpUtils.post(
    "/personal/v1/opInterviewHistory/acceptInview",
    params,
    goLogin
  );
};

//个人中心-接受或拒绝入职
export const acceptEntry = (params, goLogin) => {
  return httpUtils.post(
    "/personal/v1/opEntryHistory/acceptEntry",
    params,
    goLogin
  );
};

//个人中心-消息详情
export const newsDetails = (params, goLogin) => {
  return httpUtils.get("/personal/v1/enNews/queryById", params, goLogin);
};

//个人中心-系统消息
export const announcement = (params, goLogin) => {
  return httpUtils.get("/personal/v1/leavingNews/list", params, goLogin);
};

//个人中心-留言
export const formMessage = (params, goLogin) => {
  return httpUtils.post("/personal/v1/leavingNews/add", params, goLogin);
};

//屏蔽企业
export const screen = (params, goLogin) => {
  return httpUtils.post("/personal/v1/opShielding/add", params, goLogin);
};

//取消屏蔽企业
export const screenC = (params, goLogin) => {
  return httpUtils.post("/personal/v1/opShielding/unAdd", params, goLogin);
};
//获取微信token
export const wxLogin_setToken = (params, goLogin) => {
  return httpUtils.post("/personal/wxLogin/pc/setToken", params, goLogin);
};
//check
export const wxLogin_check = (params, goLogin) => {
  return httpUtils.get("/personal/wxLogin/pc/check", params, goLogin);
};
//获取微信token
export const wxBind_setToken = (params, goLogin) => {
  return httpUtils.post("/personal/wxBind/pc/setToken", params, goLogin);
};
//check
export const wxBind_check = (params, goLogin) => {
  return httpUtils.get("/personal/wxBind/pc/check", params, goLogin);
};
//查询绑定情况
export const queryBindState = (params, goLogin) => {
  return httpUtils.get(
    "/person/code/v1/user/third/queryBindState",
    params,
    goLogin
  );
};
//解绑
export const unbind = (params, goLogin) => {
  return httpUtils.post("/person/code/v1/user/third/unbind", params, goLogin);
};

//x下载简历
export const downloadResume = (params, goLogin) => {
  return httpUtils.get("/personal/v1/cvResume/download", params, goLogin, true);
};

//手写简历
export const saveSimpleResume = (params, goLogin) => {
  return httpUtils.post("/personal/v1/newResume/add", params, goLogin);
};

//新增简历
export const addSimpleResume = (query, goLogin) => {
  return post("/personal/v1/newResume/addNew", query, goLogin);
};

//编辑简历
export const editSimpleResume = (query, goLogin) => {
  return post("/personal/v1/newResume/edit", query, goLogin);
};

// 查询简历
export const querySimpleResume = (params, goLogin) => {
  return httpUtils.get("/personal/v1/newResume/queryById", params, goLogin);
};

// 投递简历
export const newadd = (query, goLogin) => {
  return post("/personal/v1/opDeliveryHistory/newadd", query);
};
